﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using WLMCoreLibrary;
using SAW_Core;


namespace SAW.login
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void loginButton_Click(object sender, EventArgs e)
        {
            dbConnector ConexionDB = new dbConnector();
            MiWebSiteUser usuario = new MiWebSiteUser(userName.Text,ref ConexionDB);
            if (usuario.id != 0)
            {
                if (usuario.password == userPassword.Text)
                {
                    CurrentSystemUser.LogOnUser(usuario);
                    Response.Redirect("/");
                }
            }
        }
    }
}